<script>
import {inject, toRefs} from "vue";

export default {
  name: 'Son',
  setup() {
    let sonCar = inject('car')
    return {
      ...toRefs(sonCar)
    }
  }
}
</script>

<template>
  <h3>我是孙组件,{{ name }},{{ price }}</h3>
</template>

<style scoped>
h3 {
  background-color: pink;
}
</style>